<?php
/* @var $this PurchaseOrderDetailsController */
/* @var $model PurchaseOrderDetails */

$this->breadcrumbs=array(
	'Purchase Order Details'=>array('index'),
	$model->id,
);

$this->menu=array(
    array('label'=>'Back to Purchase Order', 'url'=>array('/PurchaseOrder/view', 'id'=>$model->purchase_order_id)),

	array('label'=>'List PurchaseOrderDetails', 'url'=>array('index')),
	array('label'=>'Create PurchaseOrderDetails', 'url'=>array('create')),
	array('label'=>'Update PurchaseOrderDetails', 'url'=>array('update', 'id'=>$model->id)),
	array('label'=>'Delete PurchaseOrderDetails', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')),
	array('label'=>'Manage PurchaseOrderDetails', 'url'=>array('admin')),
);
?>

<h1>View Purchase Order Details </h1>

<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		'purchase_order_id',
		array('label'=>'Item', 'value'=>$model->item->item_desc),
		array('label' => 'Qty', 'value' => $model->qty.' '. $model->item->unit ),
		array('label' => 'Amount', 'value' => 'Php '. $model->qty * $model->item->unit_price ),
	),
)); ?>


<?php $en=purchaseOrderDetails::model()->findAll('id = :a', array(':a'=>$model->id));?>
<?php if (count($en) !== 0){?>
<br>
<h2>Item</h2>
<?php foreach ($en as $row) { ?>
<?php echo CHtml::link ( 'Update', array('item/update', 'id'=>$row->item_id)); ?>
	<?php $this->widget ('zii.widgets.CdetailView', array('data'=>$row,'attributes'=>array(
    array('label'=>'Category' , 'value'=>$row->item->category),
	array('label'=>'Date Added' , 'value'=>$row->item->date_added),
    array('label'=>'Brand' , 'value'=>$row->item->brand),
	array('label'=>'Item Description' , 'value'=>$row->item->item_desc),
	array('label'=>'Item Code' , 'value'=>$row->item->item_code),
	array('label'=>'Color' , 'value'=>$row->item->color),
	array('label'=>'Unit' , 'value'=>$row->item->unit),
	array('label'=>'Unit Price' ,  'value' => 'Php ' .$model->item->unit_price),),));?><br>
<?php }} ?>


